# Maintainer: Tim Meusel <tim@bastelfreak.de>

_gemname='minitest-proveit'
pkgname="ruby-${_gemname}"
pkgver=1.0.0
pkgrel=2
pkgdesc='forces all tests to prove success (via at least one assertion) rather than rely on the absence of failure.'
arch=('any')
url='https://github.com/seattlerb/minitest-proveit'
license=('MIT')
depends=('ruby')
makedepends=('ruby-hoe' 'ruby-bundler' 'git' 'ruby-rake')
checkdepends=('ruby-minitest')
options=('!emptydirs')
source=("git+${url}#commit=1d86852bd820e1dc4f2d204231f1ebbc1b146075")
sha512sums=('SKIP')

prepare() {
  cd "${srcdir}/${_gemname}"

}

build() {
  cd "${srcdir}/${_gemname}"
  rake package
}

check() {
  cd "${srcdir}/${_gemname}"
  rake test
}

package() {
cd "${srcdir}/${_gemname}"
  local _gemdir="$(gem env gemdir)"
  gem install --verbose --ignore-dependencies --no-user-install --install-dir "${pkgdir}/${_gemdir}" --bindir "${pkgdir}/usr/bin" "pkg/${_gemname}-${pkgver}.gem"

  install -Dm 644 README.rdoc History.rdoc -t "${pkgdir}/usr/share/doc/${pkgname}"

  rm -rf "${pkgdir}/${_gemdir}/cache"
 }
